

tel = {'jack': 4098, 'sape': 4139}
dd = list(tel.keys())
print(dd)

ddd = list(tel.values())
print(ddd)

# basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
#
# print(basket)
# a = [-1, 1, 66.25, 333, 333, 1234.5]
# del a[2:4]
#
# print(a)

# freshfruit = ['  banana', '  loganberry ', 'passion fruit  ']
# print([weapon.strip() for weapon in freshfruit])


# from collections import deque

# vec = [2, 4, 6]
# dd = [3 * x for x in vec]
# print(dd)
# queue = deque(["Eric", "John", "Michael"])
# queue.append("Terry")
# queue.append("Graham")
#
# print(queue)
# queue.popleft()
# print(queue)

# count = 1
# sum = 0
#
# while count <= 100:
#     sum = sum + count
#     count += 1
#
# print("1~100之间的和为:", sum)


# count = 0
# while count < 5:
#     print(count, " 小于 5")
#     count = count + 1
# else:
#     print(count, " 大于或等于 5")

# sites = ["Baidu", "Google","Runoob","Taobao"]
# for site in sites:
#     print(site)
#
# word = 'runoob'
# for letter in word:
#     print(letter)

# for x in range(6):
#   print(x)
# else:
#   print("Finally finished!")

# for letter in 'Runoob':
#     if letter == 'o':
#         pass
#         print('执行 pass 块')
#     print('当前字母 :', letter)
#
# print("Good bye!")

# n = 10
# a, b = 0, 1
# for i in range(n):
#     print(b)
#     a, b = b, a + b
#
# list=[1,2,3,4]
# it = iter(list)    # 创建迭代器对象
# for x in it:
#     print (x)

# class MyNumbers:
#     def __iter__(self):
#         self.a = 1
#         return self
#
#     def __next__(self):
#         x = self.a
#         self.a += 1
#         return x
#
#
# myclass = MyNumbers()
# myiter = iter(myclass)
#
# print(next(myiter))
# print(next(myiter))
# print(next(myiter))
# print(next(myiter))
# print(next(myiter))

# class MyNumbers:
#     def __iter__(self):
#         self.a = 1
#         return self
#
#     def __next__(self):
#         if self.a <= 20:
#             x = self.a
#             self.a += 1
#             return x
#         else:
#             raise StopIteration
#
#
# myclass = MyNumbers()
# myiter = iter(myclass)
#
# for x in myiter:
#     print(x)

# def max(a, b):
#     if a > b:
#         return a
#     else:
#         return b
#
# a = 4
# b = 5
# print(max(a, b))

# def printinfo(arg1, **vardict):
#     "打印任何传入的参数"
#     print("输出: ")
#     print(arg1)
#     print(vardict)
#
#
# # 调用printinfo 函数
# printinfo(1, a=2, b=3)
